import { ConfigService } from '../../core/common/config.service';
import { httpFactory } from '../../core/http/http.factory';
import { LocalXSRFStrategy } from '../../core/http/local-xsrf-strategy.service';
import { CloudSharedModule } from '../../shared/shared.module';
import { ChangePassword } from './changepassword/changepassword';
import { PasswordService } from './service/password.service';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { XSRFStrategy, Http, XHRBackend, RequestOptions } from '@angular/http';
import { Routes, RouterModule, Router } from '@angular/router';
import { CustomFormsModule } from 'ng2-validation';
const routes: Routes = [
  { path: '', redirectTo: 'console/authority' },
  { path: 'changepassword', component: ChangePassword },
];

@NgModule({
  imports: [
    CloudSharedModule,
    CustomFormsModule,
    RouterModule.forChild(routes),
    FormsModule
  ],
  declarations: [ChangePassword],
  exports: [
    RouterModule
  ],
  providers: [PasswordService,ConfigService,
    {
      provide: XSRFStrategy, useClass: LocalXSRFStrategy,
    },
    {
      provide: Http,
      useFactory: httpFactory,
      deps: [XHRBackend, RequestOptions, ConfigService, Router]
    }
  ]
})
export class AuthorityModule { }
